package com.cloud.auth.mapper.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
* 用户表(User) 实体类
*
* @author zhangxun
* @since 2020-08-18
*/
@Data
@TableName(value = "user")
public class SystemUser implements Serializable {
    private static final long serialVersionUID=1L;

    // 用户状态：有效
    public static final String STATUS_VALID = "1";
    // 用户状态：锁定
    public static final String STATUS_LOCK = "0";
    // 默认头像
    public static final String DEFAULT_AVATAR = "default.jpg";
    // 默认密码
    public static final String DEFAULT_PASSWORD = "123456";
    // 性别男
    public static final String SEX_MALE = "0";
    // 性别女
    public static final String SEX_FEMALE = "1";
    // 性别保密
    public static final String SEX_UNKNOW = "2";

    /*** 用户ID*/
    @TableId(type = IdType.AUTO)
    private Long userId;

    /*** 用户名*/
    @TableField("username")
    private String username;

    /*** 密码*/
    @TableField("password")
    private String password;

    /*** 部门ID*/
    @TableField("dept_id")
    private Long deptId;

    /*** 邮箱*/
    @TableField("email")
    private String email;

    /*** 联系电话*/
    @TableField("mobile")
    private String mobile;

    /*** 状态 0锁定 1有效*/
    @TableField("status")
    private String status;

    /*** 创建时间*/
    @TableField("create_time")
    @JsonFormat(shape= JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    /*** 修改时间*/
    @TableField("modify_time")
    @JsonFormat(shape= JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime modifyTime;

    /*** 最近访问时间*/
    @TableField("last_login_time")
    @JsonFormat(shape= JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastLoginTime;

    /*** 性别 0男 1女 2保密*/
    @TableField("ssex")
    private String sex;

    /*** 是否启用，0禁用 1启用*/
    @TableField("enable")
    private String enable;

    /*** 主题*/
    @TableField("theme")
    private String theme;

    /*** 头像*/
    @TableField("avatar")
    private String avatar;

    /*** 描述*/
    @TableField("description")
    private String description;

    /*** 部门名称*/
    @TableField(exist = false)
    private String deptName;

    @TableField(exist = false)
    private String createTimeFrom;

    @TableField(exist = false)
    private String createTimeTo;

    /*** 角色 ID*/
    @TableField(exist = false)
    private String roleId;

    @TableField(exist = false)
    private String roleName;

}